import type {  AxiosResponse, AxiosRequestConfig } from 'axios'

// 扩展 AxiosRequestConfig 添加一个拦截器的属性
interface HYInterceptors <T=AxiosResponse>{
    requestSuccessFn?: (config: AxiosRequestConfig) => AxiosRequestConfig
    requestFailureFn?: (err: any) => any
    responseSuccessFn?: (res:T ) => T
    // responseSuccessFn?: (res: any) => any
    responseFailureFn?: (err: any) => any
}

export interface hyRequestConfig<T=AxiosResponse> extends AxiosRequestConfig {
    // ?可选属性
    interceptors?: HYInterceptors<T>,
    // headers?:any
}